package com.turing.post.datatranferpmbs.util;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 实体表 -- Pmbs.CardDistribute
 * 
 * @author 杨新斌
 * 
 * @version 1.0.0
 * @since 2009-08-31
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "CardDistribute")
@IdClass(PMBSCardDistribute.class)
public class PMBSCardDistribute implements Serializable {

	/**
	 * 商户号
	 */
	@Id
	@Column(name = "MerchantNo", nullable = false)
	private String MerchantNo;

	public String getMerchantNo() {
		return MerchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		MerchantNo = merchantNo;
	}

	/**
	 * 帐务日期
	 */
	@Id
	@Column(name = "TranDate", nullable = false)
	private java.util.Date TranDate;

	public java.util.Date getTranDate() {
		return TranDate;
	}

	public void setTranDate(java.util.Date tranDate) {
		TranDate = tranDate;
	}

	/**
	 * 流水号
	 */
	@Id
	@Column(name = "TranSeqNo", nullable = false)
	private String TranSeqNo;

	public String getTranSeqNo() {
		return TranSeqNo;
	}

	public void setTranSeqNo(String tranSeqNo) {
		TranSeqNo = tranSeqNo;
	}

	/**
	 * 卡号
	 */
	@Id
	@Column(name = "CardNo", nullable = false)
	private String CardNo;

	public String getCardNo() {
		return CardNo;
	}

	public void setCardNo(String cardNo) {
		CardNo = cardNo;
	}

	/**
	 * 卡交易金额
	 */
	@Column(name = "Amount", nullable = false)
	private Integer Amount;

	public Integer getAmount() {
		return Amount;
	}

	public void setAmount(Integer amount) {
		Amount = amount;
	}

	public boolean equals(Object obj) {
		if (obj == this)
			return true;

		if (!(obj instanceof PMBSCardDistribute))
			return false;

		PMBSCardDistribute pk = (PMBSCardDistribute) obj;

		if (!MerchantNo.equals(pk.getMerchantNo()))
			return false;

		if (!TranDate.equals(pk.getTranDate()))
			return false;

		if (!TranSeqNo.equals(pk.getTranSeqNo()))
			return false;

		if (!CardNo.equals(pk.getCardNo()))
			return false;

		return true;
	}

	public int hashCode() {
		return MerchantNo.hashCode() + TranDate.hashCode()
				+ TranSeqNo.hashCode() + CardNo.hashCode();
	}

	/**
	 * Default constructor.
	 */
	public PMBSCardDistribute() {
		super();
	}
}